use "ESS.dta", clear
 
 

global controls "Female Citizen trend  i.essround"

global FE "i.yrbrn i.Country"
la var University "Graduate"


quietly: reg Meritocracy Bologna $controls $FE  if University==1, vce(cluster Country)
gen sample_m=e(sample)
 

capture erase "Maina.tex"
capture erase "Mainb.tex"
capture erase "Mainc.tex"
capture erase "Maind.tex"

 

quietly eststo m2: reg Meritocracy Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Meritocracy if short==1 & University==1
	estadd scalar ymean = r(mean)
	
quietly eststo m2y: reg Meritocracy Bologna $controls $FE if University==1 & short==1 & yrbrn<1987, vce(cluster Country)
	quietly: sum Meritocracy if short==1 & University==1  & yrbrn<1987
	estadd scalar ymean = r(mean)
	
quietly eststo m3: reg Meritocracy Bologna $controls $FE if University==1 & short==1 & ImmigrantN==0, vce(cluster Country)
	quietly: sum Meritocracy if short==1 & University==1  & ImmigrantN==0
	estadd scalar ymean = r(mean)  

	quietly eststo m4: reg Meritocracy Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Meritocracy if short==1 & Eduyears>14   
	estadd scalar ymean = r(mean)	
	
 replace Bologna=Bologna2
 replace trend=trend2  

quietly eststo m5: reg Meritocracy Bologna $controls $FE if University==1 & short==1 , vce(cluster Country)
	quietly: sum Meritocracy if short==1 & University==1 
	estadd scalar ymean = r(mean)

use "ESS.dta", clear
 
quietly eststo m6: reg Meritocracy Bologna $controls $FE if University==1 & short==1 & Jump==0, vce(cluster Country)
	quietly: sum Meritocracy if short==1 & University==1  & Jump==0
	estadd scalar ymean = r(mean)
		
	
	g M2=Meritocracy
	replace Meritocracy=Meritocracy_ordinal
quietly eststo m7: reg Meritocracy Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Meritocracy if short==1 & University==1
	estadd scalar ymean = r(mean)
	replace Meritocracy=M2
	
quietly eststo m8: reg Meritocracy Bologna $controls $FE if University==1 , vce(cluster Country)
	quietly: sum Meritocracy if  University==1
	estadd scalar ymean = r(mean)
	
	replace Bologna=Bologna_g
 quietly eststo m9: reg Meritocracy Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Meritocracy if short==1 & University==1
	estadd scalar ymean = r(mean)
	replace Bologna=replaceBologna
	
		
quietly eststo m10: reg Meritocracy Bologna c.Bologna#c.University University $controls $FE if short==1, vce(cluster Country)  
	quietly: sum Meritocracy  if short==1 & University==1 
	estadd scalar ymean = r(mean)
	
	noisily esttab  m2 m3 m4 m5 m6 m7 m8 m9 m10 m2y using "Maina.tex",  nolz  drop(*cons *essround *trend *yrbrn *Country  )  booktabs label  b(3) se(3)  star(+ 0.10 * 0.05 ** 0.01) mtitles("\shortstack{Main  \\ \textcolor{white}{tentenna}}" "\shortstack{Exclude  \\ immigrants}" "\shortstack{Include  \\  droputs}" "\shortstack{Average  \\  entry age}" "\shortstack{Exclude  \\  jump}"  "\shortstack{Ordinal  \\ DV}" "\shortstack{Long  \\ bwidths}" "\shortstack{Gradual \\ reform}"    "\shortstack{Triple \\ DiD}" "\shortstack{Larger  \\ control}" )  mgroups("\shortstack{\textbf{\normalsize Table 1}\vspace*{.1cm}}" "\shortstack{\textbf{\small Section 4}\vspace*{.1cm}}", pattern(1  0  0 0 0 0 0  0 0 1) prefix(\multicolumn{@span}{c}{) suffix(})  span erepeat(\cmidrule(lr){@span}))  stats(ymean r2   N, fmt(3 3  %9.0fc) labels(`"Output mean"' `"\textit{R}-sq"'   `"N. Obs"')) nonotes  noobs nonumbers  noeqlines coeflabels(Bologna "Reform" c.Bologna#c.University "{Reform $\times$ Grad}" University "Graduate")  ///
	 prehead("\begin{table}[hbt!] \centering \scriptsize \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}   \caption{\scshape Full outcomes for Table 1 panel a: Personal achievement  (status) \label{tabMaina}}     \begin{center}   \begin{threeparttable} \begin{tabular}{l  cccccccccc} \toprule" )  ///
	 prefoot("[1.5ex] \cmidrule(lr{0.15em}){1-11}" ) ///
	 posthead("\midrule \\[-2ex] \\\\[-5ex] \multicolumn{11}{l}{\hspace{2.5cm} \textbf{A}: \small {\textbf{Self-interest (status)}: \textit{Important to have success and be recognized}}}\\\\[-0.5ex]") ///
 postfoot("\bottomrule \end{tabular} \begin{tablenotes} \setlength\labelsep{0pt}  \item \scriptsize {\textit{Notes.} Standard errors in parentheses. \sym{+} \(p<0.1\), \sym{*} \(p<0.05\), \sym{**} \(p<0.01\). See Table 1 in the paper for specification details, and the mention in section 4 relative to the group of 'never treated countries' for the last column.}  \end{tablenotes}   \end{threeparttable}   \end{center}  \end{table}") replace
	 
 
quietly: reg Consumerism Bologna  $controls $FE  if University==1, vce(cluster Country)
gen sample_e=e(sample)

quietly eststo e1: reg Consumerism Bologna   if University==1 & short==1 & sample_e==1, vce(cluster Country)
	quietly: sum Consumerism if short==1 & University==1
	estadd scalar ymean = r(mean)
	
quietly eststo e2: reg Consumerism Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Consumerism if short==1 & University==1
	estadd scalar ymean = r(mean)
	
quietly eststo e2y: reg Consumerism Bologna $controls $FE if University==1 & short==1  & yrbrn<1987, vce(cluster Country)
	quietly: sum Consumerism if short==1 & University==1 & yrbrn<1987
	estadd scalar ymean = r(mean)
	
quietly eststo e3: reg Consumerism Bologna $controls $FE if University==1 & short==1 & ImmigrantN==0, vce(cluster Country)
	quietly: sum Consumerism if short==1 & University==1  & ImmigrantN==0
	estadd scalar ymean = r(mean)  
	
 replace Bologna=Bologna2
 replace trend=trend2  

	quietly eststo e4: reg Consumerism Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Consumerism if short==1 & Eduyears>14   
	estadd scalar ymean = r(mean)	
	
 replace Bologna=Bologna2
 replace trend=trend2  

quietly eststo e5: reg Consumerism Bologna $controls $FE if University==1 & short==1 , vce(cluster Country)
	quietly: sum Consumerism if short==1 & University==1 
	estadd scalar ymean = r(mean)

use "ESS.dta", clear
 
quietly eststo e6: reg Consumerism Bologna $controls $FE if University==1 & short==1 & Jump==0, vce(cluster Country)
	quietly: sum Consumerism if short==1 & University==1  & Jump==0
	estadd scalar ymean = r(mean)
	
	g E3=Consumerism
	replace Consumerism= Consumerism_ordinal
quietly eststo e7: reg Consumerism Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Consumerism if short==1 & University==1
	estadd scalar ymean = r(mean)
	replace Consumerism=E3
	
quietly eststo e8: reg Consumerism Bologna $controls $FE if University==1 , vce(cluster Country)
	quietly: sum Consumerism if  University==1
	estadd scalar ymean = r(mean)
	
	 replace Bologna=Bologna_g
 quietly eststo e9: reg Consumerism Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	 quietly: sum Consumerism if short==1 & University==1
	 estadd scalar ymean = r(mean)
	 replace Bologna=replaceBologna
 	
quietly eststo e10: reg Consumerism Bologna c.Bologna#c.University University $controls $FE if short==1, vce(cluster Country)  
	quietly: sum Consumerism  if short==1 & University==1 
	estadd scalar ymean = r(mean)
	
	 noisily esttab  e2 e3 e4 e5 e6 e7 e8 e9 e10 e2y using "Mainb.tex",  nolz  drop(*cons *essround *trend *yrbrn *Country  )  booktabs label  b(3) se(3)  star(+ 0.10 * 0.05 ** 0.01)  mtitles( "\shortstack{Main  \\ \textcolor{white}{tentenna}}" "\shortstack{Exclude  \\ immigrants}" "\shortstack{Include  \\  droputs}" "\shortstack{Average  \\  entry age}" "\shortstack{Exclude  \\  jump}"  "\shortstack{Ordinal  \\ DV}" "\shortstack{Long  \\ bwidths}" "\shortstack{Gradual \\ reform}"    "\shortstack{Triple \\ DiD}" "\shortstack{Larger  \\ control}" )  mgroups("\shortstack{\textbf{\normalsize Table 1}\vspace*{.1cm}}" "\shortstack{\textbf{\small Section 4}\vspace*{.1cm}}", pattern(1  0  0 0 0 0 0  0 0 1)  prefix(\multicolumn{@span}{c}{) suffix(})  span erepeat(\cmidrule(lr){@span}))  stats(ymean r2   N, fmt(3 3  %9.0fc) labels(`"Output mean"' `"\textit{R}-sq"'   `"N. Obs"')) nonotes  noobs nonumbers  noeqlines coeflabels(Bologna "Reform" c.Bologna#c.University "Reform $\times$ Grad"  University "Graduate")  ///
	 prehead("\begin{table}[hbt!] \centering \scriptsize \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}   \caption{\scshape Full outcomes for Table 1 panel b: Personal achievement (wealth) \label{tabMainb}}     \begin{center}   \begin{threeparttable} \begin{tabular}{l  cccccccccc} \toprule" )  ///
	 prefoot("[1.5ex] \cmidrule(lr{0.15em}){1-11}" ) ///
	 posthead("\midrule \\[-2ex] \\\\[-5ex] \multicolumn{11}{l}{\hspace{2.5cm} \textbf{B}: \small {\textbf{Self-interest (money)}: \textit{Important to have money and buy expensive things}}}\\\\[-0.5ex]") ///
 postfoot("\bottomrule \end{tabular} \begin{tablenotes} \setlength\labelsep{0pt}  \item \scriptsize {\textit{Notes.} Standard errors in parentheses. \sym{+} \(p<0.1\), \sym{*} \(p<0.05\), \sym{**} \(p<0.01\).}  \end{tablenotes} \end{threeparttable}   \end{center} \end{table}") replace



quietly: reg Equality Bologna  $controls $FE  if University==1, vce(cluster Country)
gen sample_e=e(sample)

quietly eststo e1: reg Equality Bologna   if University==1 & short==1 & sample_e==1, vce(cluster Country)
	quietly: sum Equality if short==1 & University==1
	estadd scalar ymean = r(mean)
	
quietly eststo e2: reg Equality Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Equality if short==1 & University==1
	estadd scalar ymean = r(mean)
	
quietly eststo e2y: reg Equality Bologna $controls $FE if University==1 & short==1 & yrbrn<1987, vce(cluster Country)
	quietly: sum Equality if short==1 & University==1  & yrbrn<1987
	estadd scalar ymean = r(mean)
	
quietly eststo e3: reg Equality Bologna $controls $FE if University==1 & short==1 & ImmigrantN==0, vce(cluster Country)
	quietly: sum Equality if short==1 & University==1  & ImmigrantN==0
	estadd scalar ymean = r(mean)  

	quietly eststo e4: reg Equality Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Equality if short==1 & Eduyears>14   
	estadd scalar ymean = r(mean)	
	
 replace Bologna=Bologna2
 replace trend=trend2  

quietly eststo e5: reg Equality Bologna $controls $FE if University==1 & short==1 , vce(cluster Country)
	quietly: sum Equality if short==1 & University==1 
	estadd scalar ymean = r(mean)

use "ESS.dta", clear
 
quietly eststo e6: reg Equality Bologna $controls $FE if University==1 & short==1 & Jump==0, vce(cluster Country)
	quietly: sum Equality if short==1 & University==1  & Jump==0
	estadd scalar ymean = r(mean)	
	
	g E2=Equality
	replace Equality=Equality_ordinal
quietly eststo e7: reg Equality Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Equality if short==1 & University==1
	estadd scalar ymean = r(mean)
	replace Equality=E2
	
quietly eststo e8: reg Equality Bologna $controls $FE if University==1 , vce(cluster Country)
	quietly: sum Equality if  University==1
	estadd scalar ymean = r(mean)
	
	 replace Bologna=Bologna_g
 quietly eststo e9: reg Equality Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	 quietly: sum Equality if short==1 & University==1
	 estadd scalar ymean = r(mean)
	 replace Bologna=replaceBologna
	
 
quietly eststo e10: reg Equality Bologna c.Bologna#c.University University $controls $FE if short==1, vce(cluster Country)  
	quietly: sum Equality  if short==1 & University==1 
	estadd scalar ymean = r(mean)
	
	
		 noisily esttab  e2 e3 e4 e5 e6 e7 e8 e9 e10 e2y using "Mainc.tex",  nolz  drop(*cons *essround *trend *yrbrn *Country   )  booktabs label  b(3) se(3) star(+ 0.10 * 0.05 ** 0.01)  mtitles("\shortstack{Main  \\ \textcolor{white}{tentenna}}" "\shortstack{Exclude  \\ immigrants}"  "\shortstack{Include  \\  droputs}"  "\shortstack{Average  \\  entry age}" "\shortstack{Exclude  \\  jump}" "\shortstack{Ordinal  \\ DV}" "\shortstack{Long  \\ bwidths}" "\shortstack{Gradual \\ reform}"     "\shortstack{Triple \\ DiD}" "\shortstack{Larger  \\ control}" )  mgroups("\shortstack{\textbf{\normalsize Table 1}\vspace*{.1cm}}" "\shortstack{\textbf{\small Section 4}\vspace*{.1cm}}", pattern(1  0  0 0 0 0 0  0 0 1)  prefix(\multicolumn{@span}{c}{) suffix(})  span erepeat(\cmidrule(lr){@span}))  stats(ymean r2   N, fmt(3 3  %9.0fc) labels(`"Output mean"' `"\textit{R}-sq"'   `"N. Obs"')) nonotes  noobs nonumbers  noeqlines coeflabels(Bologna "Reform" c.Bologna#c.University "Reform $\times$ Grad"  University "Graduate")  ///
	 prehead("\begin{table}[hbt!]  \centering \scriptsize \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}   \caption{\scshape Full outcomes for Table 1 panel c: Global justice (equality) \label{tabMainc}}     \begin{center}   \begin{threeparttable} \begin{tabular}{l  cccccccccc} \toprule" )  ///
	 prefoot("[1.5ex] \cmidrule(lr{0.15em}){1-11}" ) ///
	 posthead("\midrule \\[-2ex] \\\\[-5ex] \multicolumn{11}{l}{\hspace{2.5cm} \textbf{C}: \small {\textbf{Universalism (equality)}: \textit{Important that everyone has equal opportunity worldwide}}}\\\\[-0.5ex]") ///
 postfoot("\bottomrule \end{tabular} \begin{tablenotes} \setlength\labelsep{0pt}  \item \scriptsize {\textit{Notes.} Standard errors in parentheses. \sym{+} \(p<0.1\), \sym{*} \(p<0.05\), \sym{**} \(p<0.01\).}  \end{tablenotes} \end{threeparttable}   \end{center} \end{table}") replace



quietly: reg Environment Bologna  $controls $FE  if University==1, vce(cluster Country)
gen sample_e=e(sample)

quietly eststo e1: reg Environment Bologna   if University==1 & short==1 & sample_e==1, vce(cluster Country)
	quietly: sum Environment if short==1 & University==1
	estadd scalar ymean = r(mean)
	
quietly eststo e2: reg Equality Bologna $controls $FE if University==1 & short==1 & yrbrn<1987, vce(cluster Country)
	quietly: sum Environment if short==1 & University==1 & yrbrn<1987
	estadd scalar ymean = r(mean)

quietly eststo e2y: reg Equality Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Environment if short==1 & University==1
	estadd scalar ymean = r(mean)
	
quietly eststo e3: reg Environment Bologna $controls $FE if University==1 & short==1 & ImmigrantN==0, vce(cluster Country)
	quietly: sum Environment if short==1 & University==1  & ImmigrantN==0
	estadd scalar ymean = r(mean)  

	quietly eststo e4: reg Environment Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Environment if short==1 & Eduyears>14   
	estadd scalar ymean = r(mean)	
	
 replace Bologna=Bologna2
 replace trend=trend2  

quietly eststo e5: reg Environment Bologna $controls $FE if University==1 & short==1 , vce(cluster Country)
	quietly: sum Environment if short==1 & University==1 
	estadd scalar ymean = r(mean)

use "ESS.dta", clear
 
	
	g E4=Environment
	replace Environment=Environment_ordinal
quietly eststo e7: reg Environment Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	quietly: sum Environment if short==1 & University==1
	estadd scalar ymean = r(mean)
	replace Environment=E4
	
quietly eststo e8: reg Environment Bologna $controls $FE if University==1 , vce(cluster Country)
	quietly: sum Environment if  University==1
	estadd scalar ymean = r(mean)
	
	 replace Bologna=Bologna_g
 quietly eststo e9: reg Environment Bologna $controls $FE if University==1 & short==1, vce(cluster Country)
	 quietly: sum Environment if short==1 & University==1
	 estadd scalar ymean = r(mean)
	 replace Bologna=replaceBologna
	
 
quietly eststo e10: reg Environment Bologna c.Bologna#c.University University $controls $FE if short==1, vce(cluster Country)  
	quietly: sum Environment  if short==1 & University==1 
	estadd scalar ymean = r(mean)
	
	 noisily esttab  e2 e3 e4 e5 e6 e7 e8 e9 e10 e2y using "Maind.tex",  nolz  drop(*cons *essround *trend *yrbrn *Country   )  booktabs label  b(3) se(3) star(+ 0.10 * 0.05 ** 0.01) mtitles( "\shortstack{Main  \\ \textcolor{white}{tentenna}}" "\shortstack{Exclude  \\  immigrants}"  "\shortstack{Include  \\  droputs}" "\shortstack{Average  \\  entry age}"  "\shortstack{Exclude  \\  jump}" "\shortstack{Ordinal  \\ DV}" "\shortstack{Long  \\ bwidths}" "\shortstack{Gradual \\ reform}"   "\shortstack{Triple \\ DiD}" "\shortstack{Larger  \\ control}" )   mgroups("\shortstack{\textbf{\normalsize Table 1}\vspace*{.1cm}}" "\shortstack{\textbf{\small Section 4}\vspace*{.1cm}}", pattern(1  0  0 0 0 0 0  0 0 1)  prefix(\multicolumn{@span}{c}{) suffix(})  span erepeat(\cmidrule(lr){@span}))  stats(ymean r2   N, fmt(3 3  %9.0fc) labels(`"Output mean"' `"\textit{R}-sq"'   `"N. Obs"')) nonotes  noobs nonumbers  noeqlines coeflabels(Bologna "Reform" c.Bologna#c.University "Reform $\times$ Grad"  University "Graduate")  ///
	 prehead("\begin{table}[hbt!] \centering \scriptsize \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}   \caption{\scshape Full outcomes for Table 1 panel d: Global justice (environment) \label{tabMainc}}     \begin{center}   \begin{threeparttable} \begin{tabular}{l  cccccccccc} \toprule" )  ///
	 prefoot("[1.5ex] \cmidrule(lr{0.15em}){1-11}" ) ///
	 posthead("\midrule \\[-2ex] \\\\[-5ex] \multicolumn{11}{l}{\hspace{2.5cm} \textbf{D}: \small {\textbf{Universalism (environment)}: \textit{Important to care for  nature}}}\\\\[-0.5ex]") ///
 postfoot("\bottomrule \end{tabular} \begin{tablenotes} \setlength\labelsep{0pt}  \item \scriptsize {\textit{Notes.} Standard errors in parentheses. \sym{+} \(p<0.1\), \sym{*} \(p<0.05\), \sym{**} \(p<0.01\). }  \end{tablenotes} \end{threeparttable}   \end{center} \end{table}") replace
  